package com.cheyun.netsalev3.utils.api

import com.cheyun.netsalev3.bean.*
import com.cheyun.netsalev3.bean.aftersale.*
import com.cheyun.netsalev3.bean.basedata.BaseDataParam
import com.cheyun.netsalev3.bean.basedata.Member
import com.cheyun.netsalev3.bean.basedata.NormalList
import com.cheyun.netsalev3.bean.dms.DmsUser
import com.cheyun.netsalev3.bean.dms.DmsUserAuth
import com.cheyun.netsalev3.bean.dms.Product
import com.cheyun.netsalev3.bean.drive.*
import com.cheyun.netsalev3.bean.home.HomeReportInfo
import com.cheyun.netsalev3.bean.home.HomeTaskInfo
import com.cheyun.netsalev3.bean.login.LoginParam
import com.cheyun.netsalev3.bean.login.MemberX
import com.cheyun.netsalev3.bean.login.PhoneX
import com.cheyun.netsalev3.bean.order.*
import com.cheyun.netsalev3.bean.orderquanyi.OrderQuanyiChildParam
import com.cheyun.netsalev3.bean.orderquanyi.OrderQuanyiParam
import com.cheyun.netsalev3.bean.orderquanyi.OrderquanyiDetail
import com.cheyun.netsalev3.bean.records.Follow
import com.cheyun.netsalev3.bean.records.RecordsParam
import com.cheyun.netsalev3.bean.sys.Prdset
import com.cheyun.netsalev3.bean.task.TaskListParam
import io.reactivex.Observable
import okhttp3.ResponseBody
import org.json.JSONObject
import retrofit2.Call
import retrofit2.http.*

/**
 * @author Michael
 * @date  2018/11/6 - 15:24.
 */
interface ApiStores {
    companion object {
        //长马私有云
        const val API_SERVER_URL = GlobalConfig.API_SERVER_URL
        //分析报表
        const val ANALYSIS_URL = GlobalConfig.ANALYSIS_URL


        const val XIEYI_URL = ANALYSIS_URL + "/xieyi"
        const val KEY = "C7M8y"
        const val DOWN_URL = GlobalConfig.DOWN_URL

        const val CRM_FACE_DIR = "avatar"
        const val OSS_AccessKeyID = "LTAI4Fh79FJGCS56GSGY9uLs"
        const val OSS_AccessKeySecret = "K2a1cMGBXPp80NQfypYJoF7Dknearb"
        const val OSS_bucket = "cheyun-kfenxiang"
        const val OSS_IMAGE_URL = "http://oss-cn-hangzhou.aliyuncs.com"
        const val HTTP_SERVER_IMAGE_URL = "http://img01.chezhuliu.net/"

        const val ATTRIBUTE = "sysconf,infotype,infoplace,infosource,customerlevel,tags,ntags,mtags,ibuytime,giveupcause,exterior,interior,typecode,connectway,mlevel,callback,sex,state,customertype,purchasetype,effective,member,storeitems,invalid,followalarm,bank,paymentway,insurer,labeltype,label,followstate,reservetype,drivetype"
    }


    //基础数据
    @FormUrlEncoded
    @POST("api/v1.index/attribute")
    fun baseData(@Field("codekey") params: String): Observable<BaseResp<BaseDataParam>>

    //当前版本
    @GET("api/v1.index/version")
    fun getVersion(@Query("v") version: String,@Query("app") platform: String):Observable<BaseResp<Version>>

    //登陆
    @FormUrlEncoded
    @POST("api/v1.index/login")
    fun Login(@Field("uname") uname: String, @Field("password") password: String): Observable<BaseResp<LoginParam>>

    //发送验证码
    @FormUrlEncoded
    @POST("api/v1.center/sms")
    fun sendSms(@Field("ckey") ckey: String, @Field("akey") akey: String,@Field("mobile") mobile: String): Observable<BaseResp<Any>>

    //重置密码
    @FormUrlEncoded
    @POST("api/v1.center/forget")
    fun forget(@Field("mobile") mobile: String, @Field("password") password: String,@Field("secode") secode: String): Observable<BaseResp<Any>>

    //修改密码
    @FormUrlEncoded
    @POST("api/v1.Profile/index")
    fun changePwd(@Field("oldpassword") oldpassword: String, @Field("password") password: String,@Field("password2") password2: String): Observable<BaseResp<Any>>

    //个人信息修改
    @FormUrlEncoded
    @POST("api/v1.Profile/editProfile")
    fun editProfile(@Field("sex") sex: String, @Field("realname") realname: String,
                    @Field("birthday") birthday: String,@Field("headimg") headimg: String,
                    @Field("staffnum") staffnum: String,@Field("email") email: String,@Field("idnumber") idnumber: String
    ): Observable<BaseResp<Any>>

    //注册
    @FormUrlEncoded
    @POST("api/v1.center/register")
    fun register(@Field("mobile") mobile: String, @Field("password") password: String,@Field("realname") realname: String,
                 @Field("secode") secode: String,
                 @Field("drcode") drcode: String,
                 @Field("idnumber") idnumber: String): Observable<BaseResp<Any>>

    //经销商员工信息
    @GET("api/v1.dealer/getDmsList")
    fun getDMSUser(@Query("ickey") ickey: String): Observable<BaseResp<List<DmsUser>>>

    //加入经销商
    @FormUrlEncoded
    @POST("api/v1.dealer/joinDealer")
    fun joinDistributor(@Field("ickey") ickey: String): Observable<BaseResp<Any>>

    //我的经销商申请列表
    @GET("/api/v1.dealer/record")
    fun getJoinList(@Query("mid") mid: Int): Observable<BaseResp<List<ChannelApplyList>>>

    //撤销申请
    @FormUrlEncoded
    @POST("/api/v1.Dealer/cancel")
    fun cancelJoin(@Field("id") id: String): Observable<BaseResp<Any>>

    //获取库存数据
    @GET("api/v1.stock/datalist")
    fun getSockList(@Query("page") page: Int, @QueryMap map: Map<String, String> = HashMap<String, String>()): Observable<BaseResp<Stock>>

    //App通知设置
    @GET("api/v1.index/notice")
    fun getNotice(@QueryMap map: Map<String, String> = HashMap<String, String>()): Observable<BaseResp<Notice>>

    //获取线索数据
    @GET("api/v1.archive/datalist")
    fun getClueList(@Query("page") page: Int, @Query("nkey") state: String, @QueryMap map: Map<String, String> = HashMap<String, String>()): Observable<BaseResp<ClueParam>>

    //标注重点客户
    @FormUrlEncoded
    @POST("api/v1.Archive/isFocus")
    fun isFocus(@Field("tid") tid: String,
                        @Field("action") action: String): Observable<BaseResp<Any>>

    //获取线索详情
    @GET("api/v1.archive/get")
    fun getClueData(@Query("nkey") nkey: String, @Query("tid") tid: String, @Query("revkey") revkey: String): Observable<BaseResp<ClueDetails>>

    //订单管理列表
    @GET("api/v1.order/datalist")
    fun getOrderList(@Query("page") page: Int,
                     @Query("withcar") withcar: Int,
                     @Query("cararrive") cararrive: String,
                     @QueryMap map: Map<String, String> = HashMap<String, String>()): Observable<BaseResp<OrderParam>>

    //任务列表
    @GET("api/v1.Task/index")
    fun getTaskList(@Query("page") page: Int,
                     @QueryMap map: Map<String, String> = HashMap<String, String>()): Observable<BaseResp<TaskListParam>>

    //用户可选经销商列表
    @GET("api/v1.index/channelmember")
    fun getChannelmember(): Observable<BaseResp<List<ChannelListParam>>>

    //通道下已绑定的经销商
    @GET("api/v1.index/channelsales")
    fun getChannelsales(): Observable<BaseResp<List<SalesListParam>>>

    //切换经销商
    @GET("api/v1.index/channelchange")
    fun getChannelchange(@Query("channel") channel: Int): Observable<BaseResp<LoginParam>>

    //展厅督查-邀约客户
    @GET("api/v1.invite/datalist")
    fun getInviteData(@Query("page") page: Int, @Query("stime") stime: String): Observable<BaseResp<Yaoyue>>

    //展厅-到店列表
    @GET("api/v1.arrive/datalist")
    fun getArriveData(@Query("page") page: Int, @Query("stime") stime: String): Observable<BaseResp<DaoDian>>

    //到店详情
    @GET("api/v1.arrive/get")
    fun getDaoDianDetails(@Query("id") id: Int): Observable<BaseResp<DaoDianDetailsParam>>

    //到店客户编辑
    @FormUrlEncoded
    @POST("api/v1.arrive/update")
    fun updateDaoDianDetails(@Field("id") id: Int,
                             @Field("uname") uname: String,
                             @Field("arrpnum") arrpnum: Int,
                             @Field("arrivetime") arrivetime: String,
                             @Field("rcvuid") rcvuid: Int,
                             @Field("phone") phone: String,
                             @Field("leavetime") leavetime: String,
                             @Field("brandgroup") brandgroup: String,
                             @Field("adorderid") adorderid: String,
                             @Field("ordertype") ordertype: String,
                             @Field("isexit") isexit: String
    ): Observable<BaseResp<JSONObject>> //到店客户编辑

    //展厅-客流接待添加
    @FormUrlEncoded
    @POST("api/v1.arrive/add")
    fun addDaoDianDetails(
            @Field("uname") uname: String,
            @Field("arrpnum") arrpnum: Int,
            @Field("arrivetime") arrivetime: String,
            @Field("rcvuid") rcvuid: Int,
            @Field("phone") phone: String,
            @Field("leavetime") leavetime: String,
            @Field("brandgroup") brandgroup: String,
            @Field("resid") resid: String,
            @Field("reservetime") reservetime: String
    ): Observable<BaseResp<JSONObject>>

    //线索新增/线索编辑/线索跟进
    @FormUrlEncoded
    @POST("api/v1.archive/edit")
    fun editClue(@FieldMap params: Map<String, String>): Observable<BaseResp<ClueDetails>>

    //地区数据-省市县区
    @GET("api/v1.index/district")
    fun getDistrict(@Query("type") type: Int, @Query("pid") pid: Int): Observable<BaseResp<ArrayList<CarPinPaParam>>>

    //品牌
    @GET("api/v1.index/brand")
    fun getBrand(@Query("type") type: String, @Query("pid") pid: String): Observable<BaseResp<ArrayList<CarPinPaParam>>>

    //车系车型
    @GET("api/v1.index/brand")
    fun getBrand2(@Query("type") type: String, @Query("pid") pid: String): Observable<BaseResp<ArrayList<CarXiParam>>>

    //获取可试驾车系/车型/车牌
    @GET("api/v1.applet/getdriveseries")
    fun getDriveseries(@Query("stime") stime: String,@Query("level") level: String,@Query("pid") pid: String): Observable<BaseResp<List<Product>>>

    //线索相关记录（跟进、流转、电话
    @GET("api/v1.archive/records")
    fun getRecords(@Query("tid") type: String, @Query("mkey") mkey: String = "record"): Observable<BaseResp<List<Follow>>>

    //个人-工作台列表
    @GET("api/v1.home/personlist")
    fun getPersonlist(@Query("uid") uid: String, @Query("stime") stime: String): Observable<BaseResp<PersonlistParam>>

    //个人-逾期列表
    @GET("api/v1.home/outlist")
    fun getOutlist(@Query("page") page: Int, @Query("stime") stime: String, @Query("uid") uid: Int): Observable<BaseResp<Outlist>>

    //个人-七日强转列表
    @GET("api/v1.archive/forcelist")
    fun getForcelist(@Query("page") page: Int): Observable<BaseResp<ForcelistParam>>

    //通话记录
    @GET("api/v1.archive/calls")
    fun getcalls(@Query("page") page: Int, @Query("phone") phone: String): Observable<BaseResp<CallsParam>>

    //个人-未接电话
    @GET("api/v1.home/misslist")
    fun getMissedTellist(@Query("page") page: Int): Observable<BaseResp<MissedTelParam>>

    //管理层 – 分析报表
    @GET("api/v1.analysis/analysistoman")
    fun getAnalysisToPer(
            @Query("stime") stime: String,
            @Query("uid") uid: Int,
            @Query("etime") etime: String,
            @Query("datetype") datetype: String,
            @Query("infotype") infotype: String,
            @Query("count") count: Int = 0,
            @Query("is_mobile") is_mobile: Int = 1,
            @Query("nkey") nkey: String = "infotype"


    ): Call<ResponseBody>

    //管理层-工作台列表
    @GET("api/v1.home/managelist")
    fun getManagelist(@Query("stime") stime: String): Observable<BaseResp<ManageParam>>

    //获取线索分配数据
    @GET("api/v1.archive/datalist")
    fun getFenPei(@Query("page") page: Int, @Query("nkey") nkey: String = "archive.index", @Query("owneruid") owneruid: String = "0"): Observable<BaseResp<ClueParam>>

    //客流接待-客流接待列表
    @GET("api/v1.receive/datalist")
    fun getPassenger(@Query("page") page: Int,
                     @Query("stime") stime: String,
                     @Query("etime") etime: String): Observable<BaseResp<ReceptionParam>>

    //跟进——到店客户
    @GET("api/v1.receive/fdatalist")
    fun getPassengerF( @Query("phone") phone: String, @Query("tid") tid: String, @Query("page") page: Int, @Query("rows") rows: Int = 20): Observable<BaseResp<ReceptionParam>>

    //客流接待-接待跟进
    @GET("api/v1.receive/follow")
    fun getfollow(@Query("id") id: Int): Observable<BaseResp<FollowParam>>

    //库存管理-库存详情
    @GET("api/v1.stock/get")
    fun getStock(@Query("id") id: Int): Observable<BaseResp<StockDetailsParam>>

    //展厅督查-接待客户编辑信息回填
    @GET("api/v1.invite/get")
    fun getInviteEdit(@Query("id") id: String): Observable<BaseResp<YaoYueEditItem>>

    //客流接待-更改接收分享人
    @FormUrlEncoded
    @POST("api/v1.receive/update")
    fun getUpdate(@Field("id") id: String, @Field("shareuid") shareuid: String): Observable<BaseResp<JSONObject>>

    //客流接待-更改接收分享人
    @FormUrlEncoded
    @POST("api/v1.archive/handover")
    fun getHandover(@Field("nkey") nkey: String,
                    @Field("ids") ids: String,
                    @Field("owneruid") owneruid: String,
                    @Field("customerlevel") customerlevel: String,
                    @Field("password") password: String,
                    @Field("remindetime") remindetime: String,
                    @Field("salesid") salesid: String,
                    @Field("disttype") disttype: String
    ): Observable<BaseResp<JSONObject>>

    //客流接待-更改接收分享人
    @FormUrlEncoded
    @POST("api/v1.archive/handover")
    fun getHandoverNew(@Field("nkey") nkey: String,
                    @Field("ids") ids: String,
                    @Field("owneruid") owneruid: String,
                    @Field("customerlevel") customerlevel: String,
                    @Field("remindetime") remindetime: String
    ): Observable<BaseResp<JSONObject>>

    //线索战败审核
    @FormUrlEncoded
    @POST("api/v1.archive/failVerify")
    fun getfailVerify(
            @Field("password") password: String,
            @FieldMap params: Map<String, String>,
            @Field("nkey") nkey: String = "fail"
    ): Observable<BaseResp<JSONObject>>

    //线索无效审核
    @FormUrlEncoded
    @POST("api/v1.archive/invalidVerify")
    fun getInvalidVerify(
            @Field("password") password: String,
            @FieldMap params: Map<String, String>,
            @Field("nkey") nkey: String = "invalid"
    ): Observable<BaseResp<JSONObject>>

    //线索激活
    @FormUrlEncoded
    @POST("api/v1.archive/activate")
    fun getActivate(
            @Field("password") password: String,
            @FieldMap params: Map<String, String>,
            @Field("nkey") nkey: String = "index"
    ): Observable<BaseResp<JSONObject>>

    //工作台 切换
    @FormUrlEncoded
    @POST("api/v1.home/setWorkbench")
    fun setWorkbench(
            @Field("uid") uid: Int,
            @Field("workbench") workbench: Int
    ): Observable<BaseResp<List<JSONObject>>>

    //获取工作台列表
    @GET("api/v1.home/get")
    fun getHomeList(@Query("uid") uid: Int): Observable<BaseResp<HomeListParam>>

    //展厅督查-接待客户编辑信息回填
    @FormUrlEncoded
    @POST("api/v1.invite/update")
    fun update(
            @Field("id") id: String,
            @Field("arrivetime") arrivetime: String,
            @Field("arrpnum") arrpnum: Int,
            @Field("rcvuid") rcvuid: Int
    ): Observable<BaseResp<JSONObject>>

    //App通知列表
    @FormUrlEncoded
    @POST("api/v1.notice/datalist")
    fun noticeDatalist(
            @Field("uid") id: Int,
            @Field("page") page: Int,
            @Field("rows") size: Int? = 20
    ): Observable<BaseResp<NoticeData>>

    //判断手机号码是否存在接口
    @FormUrlEncoded
    @POST("api/v1.archive/phone")
    fun isPhone(
            @Field("phone") phone: String
    ): Observable<BaseResp<IsPhoneParam>>

    //App通知查看(更新浏览次数)
    @FormUrlEncoded
    @POST("api/v1.notice/view")
    fun noticeNum(
            @Field("uid") uid: Int,
            @Field("id") id: Int
    ): Observable<BaseResp<JSONObject>>

    //通知一键已读
    @GET("api/v1.notice/viewall")
    fun noticeAllRead(): Observable<BaseResp<JSONObject>>

    //通知一键清空
    @GET("api/v1.notice/delr")
    fun noticeAllClear(): Observable<BaseResp<JSONObject>>

    //    展厅到店号码查询线索信息
    @GET("api/v1.receive/phone")
    fun checkPhone(@Query("p") p: String):Observable<BaseResp<JSONObject>>

    @GET("api/v1.pnpcall/index")
    fun getPrivacyPhone(@Query("phonex") phoneX: String,@Query("phoneb") phoneB: String,@Query("tid") tid: String):Observable<BaseResp<PrivacyPhone>>

    //获取跟进状态  effective线索有效性 1:有效(默认) 0:待判定 2:无效
    @FormUrlEncoded
    @POST("api/v1.Archive/getFollow")
    fun getFollowStatus(@Field("effective") effective: String,@Field("tid") tid: String): Observable<BaseResp<Followstate>>

    @FormUrlEncoded
    @POST("api/v1.archive/getLevel")
    fun getLevel(
            @Field("infotype") infotype: String
    ): Observable<BaseResp<List<LevelList>>>

    //获取线索级别
    @FormUrlEncoded
    @POST("api/v1.Archive/getLevel")
    fun getClueLevel(@Field("followstate") followstate: String,@Field("tid") tid: String): Observable<BaseResp<ClueLevel>>

    @GET("api/v1.index/money")
    fun getMoney():Observable<BaseResp<MoneyParam>>

    @GET("api/v1.home/getBlist")
    fun getBlist(@Query("date") date: String,@Query("phoneb") phoneb: String):Observable<BaseResp<HomeTaskInfo>>

    @GET("api/v1.phonex")
    fun getPhoneList(@Query("phoneb") phoneb: String):Observable<BaseResp<List<PhoneX>>>

    @GET("api/v1.index/btype")
    fun getDmsProducts(@Query("type") type: Int,@Query("pid") pid: String):Observable<BaseResp<List<Product>>>

    @FormUrlEncoded
    @POST("api/v1.applet/getreserveinfo")
    fun getReserveInfo(
            @Field("qcode") qcode: String,
            @Field("phone") phone: String,
            @Field("reserveid") reserveid: String,
            @Field("rid") rid: String
    ): Observable<BaseResp<ReserveInfo>>

     //提交预约试驾
    @FormUrlEncoded
    @POST("api/v1.applet/reservemit")
    fun reservemit(@FieldMap params: Map<String, String>): Observable<BaseResp<Any>>

    //获取可试驾车系/车型/车牌
    @GET("api/v1.applet/getdriveseries")
    fun getdriveseries(@Query("stime") stime: String,
                       @Query("level") level: String,
                       @Query("pid") pid: String): Observable<BaseResp<List<NormalList>>>

    //获取可试驾时间列表
    @GET("api/v1.applet/getTimeList")
    fun getTimeList(@Query("stime") stime: String,
                       @Query("series") series: String,
                    @Query("spec") spec: String,
                       @Query("licence") licence: String): Observable<BaseResp<List<NormalList>>>

    //获取产品专家列表
    @GET("api/v1.applet/getDriveUsers")
    fun getDriveUsers(): Observable<BaseResp<List<MemberX>>>

    //试驾列表
    @GET("api/v1.applet/getdrivelist")
    fun getDriveList(@Query("page") page: Int, @Query("state") state: Int): Observable<BaseResp<DriveListParam>>

    //试驾详情
    @GET("api/v1.Applet/getreserveinfo")
    fun getDriveDetail(@Query("reserveid") reserveid: Int): Observable<BaseResp<DriveListInfo>>

    @FormUrlEncoded
    @POST("api/v1.applet/driveend")
    fun driveend(
            @Field("reserveid") reserveid: Int,
            @Field("driveuid") driveuid: Int
    ): Observable<BaseResp<Any>>

    @FormUrlEncoded
    @POST("api/v1.applet/cancel")
    fun cancelDrive(
            @Field("reserveid") reserveid: Int
    ): Observable<BaseResp<Any>>

    @FormUrlEncoded
    @POST("api/v1.applet/printpdf")
    fun printpdf(@Field("reserveid") reserveid: Int): Observable<BaseResp<Reservemit>>

    //判断是否有销售顾问权限
    @GET("api/v1.index/getdmsuserauth")
    fun getDmsAuth(@Query("uid") uid: String,@Query("channel") channel: String):Observable<BaseResp<DmsUserAuth>>

    //获取线索数据
    @GET("api/v1.apond/datalist")
    fun getAllocated(@Query("page") page: Int, @Query("promptly") promptly: String, @QueryMap map: Map<String, String> = HashMap<String, String>()): Observable<BaseResp<AllocatedParam>>

    @GET("api/v1.applet/isDriving")
    fun isDriving(): Observable<BaseResp<IsDriving>>

    @GET("api/v1.order/getorderdetail")
    fun getOrderDetail(@Query("tid") tid: Int,@Query("id") id: Int): Observable<BaseResp<OrderDetail2>>

    @GET("api/v1.order/getclocklist")
    fun getClockList(@Query("tid") tid: Int,@Query("id") id: Int): Observable<BaseResp<List<ClockData>>>

    @FormUrlEncoded
    @POST("api/v1.order/addclock")
    fun addClock(@Field("tid") tid: Int,@Field("orderid") orderid: Int,
                 @Field("nodeid") nodeid: Int,
                 @Field("payment") payment: String,
                 @Field("license") license: String,
                 @Field("operate") operate: String
                 ): Observable<BaseResp<List<ClockData>>>

    @FormUrlEncoded
    @POST("api/v1.order/confirmcartime")
    fun confirmCartime(@Field("ids") ids: String,@Field("darrivetime") darrivetime: String): Observable<BaseResp<Any>>

    @FormUrlEncoded
    @POST("api/v1.order/addeliver")
    fun addeliver(@Field("ids") ids: String): Observable<BaseResp<Any>>

    @FormUrlEncoded
    @POST("api/v1.order/servicing")
    fun servicing(@Field("ids") ids: String): Observable<BaseResp<Any>>

    @GET("api/v1.arrive/getbindlist")
    fun getOrderBindlist(
            @Query("page") page: Int,
            @Query("phone") phone: String,
            @Query("rcvuid") rcvuid: String,
            @Query("tid") tid: String):Observable<BaseResp<OrderDaodianParam>>

    @GET("api/v1.adorder/getadorderlist")
    fun getOrderChooselist(@Query("page") page: Int,@Query("phone") phone: String):Observable<BaseResp<OrderChooseParam>>

    //保养预约列表
    @GET("api/v1.maintain/getmaintList")
    fun getMaintenanceList(@Query("page") page: Int,
                           @Query("state") state: String,
                     @QueryMap map: Map<String, String> = HashMap<String, String>()): Observable<BaseResp<MaintenanceParam>>

    //保养预约详情
    @GET("api/v1.maintain/detail")
    fun getMaintenanceDetail(@Query("id") id: Int): Observable<BaseResp<MaintenanceDetail>>

    //取消保养
    @FormUrlEncoded
    @POST("api/v1.maintain/cancel")
    fun cancelMaintenance(@Field("id") id: Int): Observable<BaseResp<Any>>

    //保养预约--取消保养根据VIN查询取送车信息
    @FormUrlEncoded
    @POST("api/v1.maintain/getTakecarListByVIN")
    fun cancelMaintenanceInfo(@Field("vin") vin: String): Observable<BaseResp<DriveParam>>

    //确认保养
    @FormUrlEncoded
    @POST("api/v1.maintain/confirm")
    fun confirmMaintenance(@Field("id") id: Int): Observable<BaseResp<Any>>

    //保养预约-分配服务顾问
    @FormUrlEncoded
    @POST("api/v1.maintain/allocation")
    fun allocationMaintenance(@Field("ids") ids: String,@Field("serciveuid") serciveuid:String): Observable<BaseResp<Any>>

    //保养预约-添加/编辑
    @FormUrlEncoded
    @POST("api/v1.maintain/editmaintence")
    fun editMaintenance(@FieldMap params: Map<String, String>): Observable<BaseResp<Any>>

    //保养预约/取送车--获取DMS车主信息
    @GET("api/v1.maintain/getDmsCarOwners")
    fun getCarOwnerList(@Query("page") page: Int,
                        @QueryMap map: Map<String, String> = HashMap<String, String>()): Observable<BaseResp<CarOwnerParam>>

    //上门取送车列表
    @GET("api/v1.takecar/getTakecarList")
    fun getDriveCarList(@Query("page") page: Int,
                           @Query("state") state: String,
                           @QueryMap map: Map<String, String> = HashMap<String, String>()): Observable<BaseResp<DriveParam>>

    //保养预约详情
    @GET("api/v1.takecar/detail")
    fun getAftersaleDriveDetail(@Query("id") id: Int): Observable<BaseResp<DriveDetail>>

    //上门取送车-添加/编辑
    @FormUrlEncoded
    @POST("api/v1.takecar/editTakecar")
    fun editTakecar(@FieldMap params: Map<String, String>): Observable<BaseResp<EditDriveBack>>

    //上门取送车-获取预估费用
    @FormUrlEncoded
    @POST("api/v1.takecar/getPlanPrice")
    fun getPlanPrice(@Field("id") id: Int): Observable<BaseResp<DrivePlanData>>

    //上门取送车-下单(滴滴/e代驾)
    @FormUrlEncoded
    @POST("api/v1.takecar/publishOrder")
    fun drivePublishOrder(@Field("plantotalfee") plantotalfee: String,@Field("planmileage") planmileage: String,@Field("id") id: Int): Observable<BaseResp<Any>>

    //上门取送车-取消客户预约订单(包含代驾订单)
    @FormUrlEncoded
    @POST("api/v1.takecar/cancel")
    fun cancelDriveOrder(@Field("id") id: Int): Observable<BaseResp<Any>>

    //上门取送车-取消代驾订单(不取消小程序客户预约订单)
    @FormUrlEncoded
    @POST("/api/v1.takecar/cancelToDrive")
    fun cancelSingleDriveOrder(@Field("id") id: Int): Observable<BaseResp<Any>>

    //上门取送车-分配服务顾问
    @FormUrlEncoded
    @POST("api/v1.takecar/allocation")
    fun allocationDrive(@Field("ids") ids: String,@Field("serciveuid") serciveuid:String): Observable<BaseResp<Any>>

    //保养预约/取送车--获取可选分配的服务顾问列表
    @GET("api/v1.maintain/getUsableUserList")
    fun getAftersaleUsableUserList(): Observable<BaseResp<List<Member>>>

    //根据扫码返回的手机号/tid查询线索信息
    @GET("api/v1.applet/getArchiveByPhone")
    fun getArchiveByPhone(@Query("phone") phone: String): Observable<BaseResp<DriveArchiveData>>

    //获取功能切换
    @GET("api/v1.index/getprdset")
    fun getprdset(): Observable<BaseResp<List<Prdset>>>

    //删除账号
    @FormUrlEncoded
    @POST("api/v1.member/delaccount")
    fun delaccount(@Field("mid") mid: String,@Field("mobile") mobile: String,@Field("smscode") smscode: String): Observable<BaseResp<Any>>

    //订单权益用户列表
    @GET("api/v1.Award/getOrderList")
    fun getOrderQuanyiList(@Query("page") page: Int,
                           @Query("state") state: String,
                           @QueryMap map: Map<String, String> = HashMap<String, String>()): Observable<BaseResp<OrderQuanyiParam>>

    //订单权益用户列表
    @GET("api/v1.Award/getAwardList")
    fun getOrderQuanyiAllList(@Query("page") page: Int,
                           @Query("orderId") orderId: String,
                              @Query("state") state: String,
                           @QueryMap map: Map<String, String> = HashMap<String, String>()): Observable<BaseResp<OrderQuanyiChildParam>>

    //订单权益详情
    @GET("api/v1.Award/getAwardDetail")
    fun getOrderquanyiDetail(@Query("awid") awid: Int): Observable<BaseResp<OrderquanyiDetail>>

    //订单权益确认
    @FormUrlEncoded
    @POST("api/v1.Award/pushAward")
    fun querenOrderquanyiDetail(@Field("awid") awid: Int): Observable<BaseResp<Any>>

    @FormUrlEncoded
    @POST("api/v1.Award/scanAward")
    fun orderquanyiCheck(@FieldMap params: Map<String, String>): Observable<BaseResp<Any>>


}